<template>
  <div>
    <nav-head/>
    <db-carousel />
    <novel-carousel :channelend="channelend" :channelend2="channelend2"/>
    <!-- <best-selling /> -->
    <nearly-over :channelBook="channelBook" :channelBook2="channelBook2"/>
    <book-card/>
    <sort :channelBook="channelBook" :channelBook2="channelBook2"/>
    <famous/>
    <router-view />
  </div>
</template>
<script>
import NavHead from "../components/channel/NavHead.vue"
import DbCarousel from "../components/channel/DbCarousel"
import NovelCarousel from "../components/channel/NovelCarousel"
import NearlyOver from '../components/channel/NearlyOver'
// 第三层小说轮播图
// import BestSelling from '../components/channel/BestSelling'
//排行榜
import BookCard from '../components/channel/BookCard'

//排行榜下面的轮播
import Sort from '../components/channel/Sort.vue'

import Famous from '../components/channel/Famous'


export default ({
  data(){
    return{
      channelBook:[],
      channelBook2:[],
      channelend:[],
      channelend2:[]
    }
  },
  mounted(){
    this.axios.get("/book/origin").then(result=>{
      // console.log(result)
      // console.log(result.data);
      let arr = result.data.data.slice(0,5);
      let arr2 = result.data.data.slice(5,10);
      let endbook = result.data.data.slice(6,8)
      let endbook2 = result.data.data.slice(2,4)
      this.channelend.push(...endbook);
      this.channelend2.push(...endbook2);
      this.channelBook2.push(...arr2);
      // console.log(Object.prototype.toString.call(arr));
      this.channelBook.push(...arr);
      console.log(this.channelend);
    })
  },
  components: {
    NavHead,DbCarousel,NovelCarousel,NearlyOver,Famous,BookCard,Sort
  },
})

</script>
<style lang="scss">
* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f8f8f8;
}

</style>
